<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../../attr.jsp" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!doctype html>
<html>
<meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="${ctx}/css/sapar.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/common.css" />
<script type="text/javascript" src="${ctx}/js/jquery.js"></script>
<script type="text/javascript" src="${ctx}/js/sapar.js"></script>
<script type="text/javascript" src="${ctx}/js/WdatePicker.js"></script>
<script type="text/javascript" src="${ctx}/assets/layer/layer.js"></script>
<title>灭菌管理</title>
</head>

<body>
    <div id="saper-container">
        <div id="saper-hd"></div>
        <div id="saper-bd">
            <div class="subfiled clearfix">
                <h2>灭菌</h2>
            </div>
            <div class="subfiled-content">
                <div class="search-box clearfix">
                    <div class="kv-item clearfix">
                        <label>包条码：</label>
                        <div class="kv-item-content">
                            <input type="text" id="searchTxt" name="searchTxt" placeholder="灭菌包条码"  class="search_text">
                        </div>
                        <div class="kv-item-content">
                             <a href="javascript:;"    class="sapar-btn sapar-btn-recom query-btn" id="save" >保存</a>
                         </div>
                    </div>
                </div>
                <!--表格开始-->
                <div class="table">
                    <!--表格操作-->
                    <!-- <div class="table-operate ue-clear">
                        <div>
	                        <a href="javascript:;" class="add">添加</a>
							<a href="javascript:;" class="edit">修改</a>
	                        <a href="javascript:;" class="del">删除</a>
                        </div>
                    </div> -->
                    <!--表格具体内容-->
                    <div class="table-box">
                        <table>
                            <thead>
                                <tr>
                               		
                                    <th>包条码</th>
                                    
                                </tr>
                            </thead>
                            <tbody>
                            	 
                            </tbody>
                        </table>
                    </div>
                    <div class="kv-item clearfix">
                         
                  </div>
                </div><!--表格结束-->
            </div>
        </div>
        <div id="saper-ft">
       	 	 
        </div>
    </div>
    
</body>

<script type="text/javascript">
  	var isover = 0;
   	var miejun = new Object();
   	var baoArray = new Array();
  	String.prototype.startWith = function(compareStr){
  		return this.indexOf(compareStr) == 0;
  	}
	document.onkeydown=function(event){
		var e = event || window.event || arguments.callee.caller.arguments[0];
		if(e && e.keyCode==27){ // 按 Esc 
		//要做的事情
		}
		if(e && e.keyCode==113){ // 按 F2 
		//要做的事情
		} 
		if(e && e.keyCode==13){ // enter 键
			//要做的事情
			var text1 = $("#searchTxt").val();
 			if((text1.startWith('RZS') || text1.startWith('CZS'))&&text1.length==13){
 				miejun.bao = text1;
 			}
 			/* miejun.bao = text1; */
// 			else{
// 				peibao.lan = text1;
// 			}
			if(miejun.bao !=null){
				var str = "<tr><td>"+miejun.bao+"</td></tr>";
				$(".table-box tbody").append(str);
				baoArray.push(miejun.bao);
				// 清空配包的属性
				miejun = new Object();
			}
			$("#searchTxt").val('');
		}
	}; 
	window.onload = function(){
		$("#searchTxt").focus();
	}
	$(function(){
		$("#save").click(function(){
			var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
// 			$(".table-box tbody tr td").each(function(){
				
// 			})
			 parent.callbackPackData(baoArray);
		 	 parent.layer.close(index);
		})
	})
</script>
</html>